package com.vernhe;

import com.vernhe.feignClient.MyFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @EnableFeignClients 表示这是一个OpenFeign客户端
 *
 * @author VernHe
 * @date 2022年02月18日 16:08
 */
@SpringBootApplication
@EnableDiscoveryClient
@RestController
@EnableFeignClients
public class FeignClientApplication {

    @Autowired
    private MyFeignClient client;

    @GetMapping("/hello")
    public String hello() {
        return client.hello();
    }

    public static void main(String[] args) {
        SpringApplication.run(FeignClientApplication.class, args);
    }


}
